package org.hongqi.common.senpec.sys.menu;

import org.apache.ibatis.annotations.Mapper;
import org.hongqi.common.senpec.base.mybatisplus.IBaseMapper;

import java.util.Collection;

@Mapper
public interface MenuMapper extends IBaseMapper<Menu> {

    Collection<Menu> selectExcludeButton();

    Collection<Menu> selectMenusByRoleId(Long roleId);

    Integer deleteMenuIdsByRoleId(Long roleId);

    Integer insertMenuIdByRoleId(Long roleId, Long menuId);

    Collection<Menu> selectMenuItemsByUserId(Long userId);

    Integer deleteMenuIdByRoleId(Long roleId, Long buttonId);

    Integer deleteMenuNotButtonIdsByRoleId(Long roleId);

    Integer selectMaxSequenceByParent(Long pid);

    Collection<Long> selectIdsByParent(Long pid);

    Collection<Menu> selectByParent(Long pid);

    Collection<String> selectAuthoritiesByUserId(Long userId);

    Collection<String> selectRoleNamesByUserId(Long userId);

    Collection<String> selectAuthoritiesByUsername(String username);

    Collection<String> selectRoleNamesByUsername(String username);
}
